﻿using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;

namespace QuizzAdminData
{
    /// <summary>
    /// DB klasse met conection string
    /// </summary>
    /// <author>Kenny Vaneetvelde</author>
    public static class QuizAdminDB
    {

        /// <summary>
        /// Haal de connectie met de DB op.
        /// </summary>
        /// <returns>new SqlConnection</returns>
        /// <author>Kenny Vaneetvelde</author>
        public static SqlConnection GetConnection()
        {
            //string connectionString = "Data Source=.;Initial Catalog=QuizzDB;Integrated Security=True";
            string connectionString = "Data Source=(LocalDB)\\v11.0;AttachDbFilename=|DataDirectory|\\QuizzDB.mdf;Integrated Security=True;Connect Timeout=30";
            //string connectionString = "Data Source=.;AttachDbFilename=|DataDirectory|\\QuizzDB.mdf;Integrated Security=True;Connect Timeout=30";

            SqlConnection connection = new SqlConnection(connectionString);

            return connection;
        }
    }
}
